#!/usr/bin/python
# POLITEIA_LICENSE

from optparse import OptionParser
from GameHandler import GameHandler

from ogre.renderer.OGRE import OgreException
import os

def parseCmd():
    parser = OptionParser()
    parser.add_option("-f", "--fullscreen", dest="fullscreen",
            help="Set switch to enable fullscreen mode", action="store_true")
    parser.add_option("-w", "--window", dest="fullscreen",
            help="Set switch to disable fullscreen mode", action="store_false")
            
    return parser.parse_args()

if __name__ == '__main__':
    result, args = parseCmd()
    try:
        handler = GameHandler(os.path.dirname(__file__), result.fullscreen)
        handler.run()
        handler.deinit()
    except OgreException, e:
        print "Got Error %s" % str(e)
    
